Text [DefaultDestDir95] := Program Files\Allied General DEMO
Directory [SetupDir] := SETUP
Directory [SourceDir] := AG
Directory [TargetDir] := BlankString
Directory [TargetDrive] := BlankString
Directory [UninstallDirectory] := BlankString
Directory [SetupDirectory] := BlankString
Text [FileReplaceExe] := BlankString
Number [Options] := 2
Logical [Complete] := N
Logical [Typical] := N
Logical [Minimal] := N
Logical [IsWin95] := N
Logical [IsWinNT] := N
Logical [PreviousInstall] := N
Text [PreviousInstallOption] :=
Logical [InstallWin32s] := N
Logical [Root] := N
Text [CurrentInstallOpt]
TextArray [NotEnufFreeHDSpace]
Text [SignOffText] := Installation is complete.
Text [Drive] := C
Text [DelteingFilesText] := Deleting files, please wait...
Text [NoFreeSpaceText] := megabytes of free disk space is required! If available select another drive or free up the needed space and try again.
Text [WhichLanguage] :=
Text [InstallText] := Install
Text [ConfigText1] := Setup can optimize the program for your computer's speed.
Text [ConfigText2] := Do you want to optimize the program?
Text [YES_text] := OK
Text [NO_text] := No
Text [EXIT_text] := Exit
Text [HelpText] := Help
Text [DRIVE_text] := Select Drive
Text [OPTION_text] := Select Option
Text [UninstallIconText] := Uninstall
Text [WaitText] := Please wait...
Text [ContinueText] := Click 'OK' to continue. Click 'No' to Cancel.
Text [Win32sText] := Setup needs to install or upgrade Win32s for this program to run properly.
Text [CheckSystemFilesText] := Checking system files.
Text [RestartReminderText] := Don't forget to restart Windows.
Text [RestartText] := Your system needs to be restarted before beginning. Select 'OK' to restart or 'No' to Cancel.
Text [SelectInstallDirText] := Please choose an installation directory on a fixed drive (example: C: or D: drive).
Text [SelectInstallDirText2] := Type in your choice below and select `Ok' to install, or `Exit' to exit the installation now.
Text [SelectWin95InstallDirText] := Setup can install
Text [SelectWin95InstallDirText1] := into the directory listed below, or you may enter a directory of your choice.
Text [SelectWin95InstallDirText3] := Be sure to include the drive letter. Example:
Text [SelectWin95InstallDirText4] := C:\My Destination Directory
Text [SelectWin95InstallDirText2] := Click 'OK' to accept or 'Exit' to end installation now.
Text [PromptForOptsText] := There is not enough free disk space on drive.
Text [PromptForOptsText2] := Click 'Select Option' to choose another install option. Click 'Select Drive' to keep the current option and choose another hard drive. Click 'Exit' to exit the installation now.
Text [NoWinDirText] := This install does not allow installation to the Windows directory! Please select another location.
Text [NoInstallRootText] := This install does not allow installation to the root of your hard drive!
Logical [Win32Installed] := N
Text [Language] := English
Text [FloatingFileSetSize] :=
Number [FileSetSize] :=
Number [CompleteSize] := 35000000
Number [TypicalSize] := 3000000
Number [MinimalSize] := 0
Number [WinGSize] := 311000
Number [UninstallSize] := 250000
Number [CopyDlgYPos] := 0
Number [FileCount] := 0
Number [Choice] := 1010
Number [Continue] := 1012
Number [Win32sContinue] := 1020
Number [W32sInstall] := 1018
Number [Install] := 1014
Number [Restart] := 1016
Directory [Win32sDir] := WIN32S
Text [Win32sListFile] := WIN32S.LST
Text [Win32sIniFile] := WIN32S.INI
Text [Win32sSection] := Win32s
Text [Win32sVersionKey] := Version
Text [Win32sCurrentVersion] := 1.30.166.0
Text [Ole32sCurrentVersion] := 2.3.130.166
Logical [Win32sIniFail] := N
Logical [Win32sDirFail] := N
Logical [Win32sNeeded] := N
Text [Win32sPrevVersion] := 1.25.142.0
Logical [Win32s] := N
Logical [DotParsed] := N
Logical [BootSectionInvalid] := N
TextArray [Win32Array]
Number [Win32sSize] := 5150000
Number [Ole32sSize] := 1175000
Logical [Ole32sNeeded] := N
Logical [InstallWinG] := N
Text [FileInUse] := BlankString
Text [FileVersionSource] :=
Text [FileVersionDest] :=
EndDefineVariables
;;-------------------- BEGIN MAIN --------------------------------------------
SetDefaultBitmap Off
SetInstallModeTo Install
SetTraceMode Off
SetExitConfirmationPrompt off
SetReplacementInquiry Off
SetPopupBorderTo double
SetPopupAttrTo BlackOnLightGray
SetBackgroundColor 0 0 0 0 0 0 ;; set to Black
[CopyDlgYPos] := MaxY - 155
Do WhichWindows
If [IsWin95]
Do Windows95_INSTALL
Else
If [IsWinNT]
Do WindowsNT_INSTALL
Else
Do WIN31_INSTALL
EndIf
EndIf
If [IsWin95]
Else
Do SignOff
EndIf
:EXIT
SoLong Quietly
;;--------------------- END MAIN ------------------------------------------
Procedure Windows95_INSTALL
;; Do CheckTempForIni ;; temp ini left by AUTORUN.EXE
Do SetLanguage
SetTopLineTo [ProductName] [InstallText]
Do DisplayLogo
Do CheckSystemColors
Do GetInstallOptions
Do GetPreviousInstallOption
If [PreviousInstall]
Do DeInstall
EndIf
Do INSTALL
Do WriteInstallInfoToIni
Do InstallWinG
Do CheckFilesInUse
If FileExists [InstallationDirectory]\[MainExeName] ;; Run Program
ChangeDirectoryTo [InstallationDirectory]
Run [InstallationDirectory]\[MainExeName] nowait
EndIf
:EXIT
UnloadBitmap 1
EndProcedure
Procedure WIN31_INSTALL
;; Do WhichLanguage
Do SetLanguage
SetTopLineTo [ProductName] [InstallText]
Do DisplayLogo
Delay 1000
Do CheckSystemColors
TextBox
[WaitText]
[CheckSystemFilesText]
EndTextBox
If WIN32
Else
Do CheckWin32s
EndIf
Do GetInstallOptions
Do GetPreviousInstallOption
If [PreviousInstall]
Do DeInstall
EndIf
Do INSTALL
Do WriteInstallInfoToIni
If [Win32sNeeded]
Do PromptInstallWin32s
Do ValidateSystemIniFile
Do EditSystemIniFile
EndIf
If [Ole32sNeeded]
Do VerInstallOle32s
If DirectoryExists [WindowsSystemDirectory]\WIN32S
Do W32sDeleteFiles
EndIf
EndIf
Do InstallWinG
If [InstallWinG]
Do RestartWindows
GoTo EXIT
EndIf
If [Win32Installed] .OR. FileInUse
Do RestartWindows
EndIf
If [InstallWinG]
Do RestartWindows
EndIf
:EXIT
ClearScreen
UnloadBitmap 1
EndProcedure
Procedure WindowsNT_INSTALL
;; Do Runanim
;; Do WhichLanguage
Do SetLanguage
SetTopLineTo [ProductName] [InstallText]
Do DisplayLogo
Do CheckSystemColors
Do GetInstallOptions
Do GetPreviousInstallOption
If [PreviousInstall] ;;Fix or change this
Do DeInstall
EndIf
Do INSTALL
Do WriteInstallInfoToIni
Do InstallWinG
:EXIT
ClearScreen
UnloadBitmap 1
EndProcedure
;;------------------------- END MAIN ----------------------------------------
;;------------------------- BEGIN INSTALL PROCEDURE -------------------------
Procedure INSTALL
ClearScreen
Do TrimInstallFromDir
SetCopyAttrTo 00
If [Complete]
Logging On
CopyFiles from [InstallFromDirectory]\[SourceDir] to [InstallationDirectory] @xy(0, [CopyDlgYPos]) [FileSetSize]
AGDEMO.ICO
readme.txt
*.exe
DATA\*.* as DATA\*.*
ART\*.* as ART\*.*
SCENARIO\*.* as SCENARIO\*.*
EndCopyFiles
EndIf
If [Typical]
Logging On
CopyFiles from [InstallFromDirectory]\[SourceDir] to [InstallationDirectory] @xy(0, [CopyDlgYPos]) [FileSetSize]
AGDEMO.ICO
readme.txt
*.exe
DATA\*.* as DATA\*.*
SCENARIO\*.* as SCENARIO\*.*
EndCopyFiles
EndIf
CopyFiles from [InstallFromDirectory]\SETUP to [InstallationDirectory] Quietly
UNINST.EXE
UNINST.INF
EndCopyFIles
If [IsWin95] ;; Copy and Run Registry only if Windows 95.
CopyFiles from [InstallFromDirectory]\SETUP to [InstallationDirectory] Quietly
REGISTRY.EXE
AG.RGS
EndCopyFIles
Do RunRegistry
EndIf
Do RestoreInstallFromDir
Do CreateAutoIniFile
Do CreateProgramGroup
EndProcedure
;;-------------------------- END INSTALL PROCEDURE -------------------------
AddOrChangeLineWith (device=,,[WindowsSystemDirectory]\WIN32S\W32S.386) as "device=[WindowsSystemDirectory]\WIN32S\W32S.386" at Beginning IgnoreRemarks
;; InsertAtLine End [String1]
EndModifyTextFile
EndProcedure
Procedure ValidateSystemIniFile
ClearArray [Array2]
[Array2][1] := boot
[Array2][2] := drivers
[Array2][3] := ""
[Array2][4] := [WindowsDirectory]\SYSTEM.INI
GetPrivateProfileString Using [Array2] NoBackup
[String1] := [Array2][5]
[String2] := "WINMM16.DLL"
[Number1] := 1
[Number2] := LengthOf [String2]
[Number3] := LengthOf [String1]
[String3] := SubstringOf [String1] from [Number1] to [Number2]
While [String2] <> [String3]
[Number1] := [Number1] + 1
[Number2] := [Number2] + 1
If [Number2] > [Number3]
[BootSectionInvalid] := Y
GoTo Validate386EnhSection
EndIf
[String3] := SubstringOf [String1] from [Number1] to [Number2]
EndWhile
:Validate386EnhSection
EndProcedure
Procedure SignOff
DeleteFiles from [WindowsDirectory] Quietly
*.01
EndDeleteFiles
Dialog BlackOnLightGray UseHeader "Allied General DEMO "
[SignOffText]
EndDialog
EndProcedure
Procedure RestartWindows
Do RestartDlgBox
If [Restart] = 1016
If FileInUse
SetCopyAttrTo 00
CopyFiles from [SetupDirectory] to [WindowsSystemDirectory] Quietly